package cn.itcast.dao;

import cn.itcast.domain.Courier;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface CourierDao extends JpaRepository<Courier,Integer>,JpaSpecificationExecutor<Courier> {
    /**
     * 作废快递员
     *
     * @param id
     */
    @Query("update Courier set deltag='1' where id =?1")
    @Modifying
    public void delBatch(int id);

    /**
     * 还原
     * @param id
     */
    @Query("update Courier set deltag=null where id =?1")
    @Modifying
    public void restore(int id);




}
